package com.example.springboot_shiro.utils;

import java.util.Random;

/**
 * @author: lqy
 * @date: 2021/9/8 14:18
 * @description:
 */
public class SaltUtils {
    public static String getSalt(int n) {
        char[] chars = "QWERTYUIOPASDFGHJKLZXCVBNMzxcvbnmlkjhgfdsaqwertyuiop0123456789".toCharArray();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < n; i++) {
            char aChar = chars[new Random().nextInt(chars.length)];
            sb.append(aChar);
        }
        return sb.toString();
    }
}
